const { defineConfig } = require('@vue/cli-service')
const timeStamp = new Date().getTime()

module.exports = defineConfig({
  transpileDependencies: true,
  runtimeCompiler: false,
  productionSourceMap: false,
  devServer:{
    client:{
      overlay: {
        errors: true,
        warnings: false,
        runtimeErrors: true,
      },
    },
    proxy:{
      '/member':{
        target:process.env.VUE_APP_API_ROOT ,
        changeOrigin:true,
        ws:false,
        pathRewrite:{'^/member':'/member'},
      },
      '/pub':{
        target:process.env.VUE_APP_API_ROOT ,
        changeOrigin:true,
        ws:false,
        pathRewrite:{'^/pub':'/pub'},
      },
      '/dating':{
        target:process.env.VUE_APP_API_ROOT ,
        changeOrigin:true,
        ws:false,
        pathRewrite:{'^/dating':'/dating'},
      },
    }
  },
  filenameHashing: false,
  configureWebpack: {
    output: {
      filename: `js/[name].${timeStamp}.js`,
      chunkFilename: `js/chunk.[id].${timeStamp}.js`,
    },
    //在configureWebpack中添加以下代码

  },
  css: {
    extract: {
      filename: `css/[name].${timeStamp}.css`,
      chunkFilename: `css/chunk.[id].${timeStamp}.css`,
    },
  },

})
